﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="managerUser.ascx.cs" Inherits="Admin_Views_module_managerUser" %>

<style type="text/css">
    .style1
    {
        width: 214px;
    }
    .style2
    {
        width: 67px;
    }
    .style3
    {
        float: right;
        width: 67px;
    }
</style>

<script type="text/javascript">
    function confirm_delete() {
        if (confirm("Có chắc chắn bạn muốn xóa ?") == true)
            return true;
        else
            return false;
    }
</script>
<form id="form1" runat="server">
<div class="box">
    <div class="left">
    </div>
    <div class="right">

    </div>
    <div class="heading">
        <h1 style="background-image: url('Views/Image/user.png');">
            <span>Khách Hàng</span>

        </h1>
        <div class="buttons">
            
               <asp:Button ID="LinkButton" runat="server" 
                Text="Tạo mới" onclick="Button1_Click" />
        </div>

        
        
    </div>
    <% if (Session["create"] == "" || Session["create"] == null)
       {%>
    <div class="content">
        <asp:DataList ID="DataList1" runat="server" Width="100%" 
            DataKeyField="customer_id" oneditcommand="DataList1_EditCommand" 
            ondeletecommand="DataList1_DeleteCommand" 
            onupdatecommand="DataList1_UpdateCommand">
            <HeaderTemplate>
                <table width="100%" class="tableadmin" >
                    <tr class="trhead">
                        <th align="center">
                            Họ 
                        </th>
                        <th align="center">
                            Tên
                        </th>
                        <th align="center">
                            Email
                        </th>
                        <th align="center">
                            Địa Chỉ
                        </th>
                        <th align="center">
                            Số Điện Thoại
                        </th>
                        <th align="center">
                            Ngày đăng ký
                        </th>
                        <th align="center">
                            Hành Động
                        </th>
                    </tr>
            </HeaderTemplate>
            <ItemTemplate>
                <tr >
                    <td align="center">
                        <%# Eval("first_name") %></td>
                    <td align="center">
                        <%#Eval("last_name")%>
                    </td>
                    <td align="center">
                        <%# Eval("email") %>
                    </td>
                    <td align="center">
                        <%# Eval("address")%>
                    </td>
                    <td align="center">
                        <%# Eval("phone") %>
                    </td>
                    <td align="center">
                        <%# Eval("date_added") %>
                    </td>
                    <td align="center"><asp:ImageButton AlternateText="Edit" ImageUrl="~/image/Edit.gif" ID="EditLinkButton"
                            CommandName="Edit" Text="Edit" runat="server" />
                        <asp:ImageButton AlternateText="Delete"
                                ImageUrl="~/image/Delete.gif" ID="DeleteLinkButton" CommandName="Delete" Text="Delete"
                                runat="server" OnClientClick = "return confirm_delete();" /> 
                    </td>
                </tr>
            </ItemTemplate>
            <EditItemTemplate>
                <tr>
                    <td align="center">
                        <asp:TextBox ID="txtEdFirstName" runat="server" Text='<%# Bind("first_name") %>'></asp:TextBox>
                    </td>
                    <td align="center">
                         <asp:TextBox ID="txEdtLastName" runat="server" Text='<%# Bind("last_name") %>'></asp:TextBox>
                    </td>
                    <td align="center">
                        <asp:TextBox ID="txtEdEmail" runat="server" Text='<%# Bind("email") %>'></asp:TextBox>
                    </td>
                    <td align="center">
                        <asp:TextBox ID="txtEdAddress" runat="server" Text='<%# Bind("address")%>'></asp:TextBox>
                    </td>
                    <td align="center">
                        <asp:TextBox ID="txtEdPhone" runat="server" Text='<%# Bind("phone") %>'></asp:TextBox>
                    </td>
                    <td align="center">
                        <asp:TextBox ID="txtEdDate" runat="server" Text='<%# Eval("date_added") %>'></asp:TextBox>
                    </td>
                    <td align="center">
                        <asp:Button ID="Button2" runat="server" Text="Lưu" CommandName="Update" />
                    </td>
                </tr>
            </EditItemTemplate>
        </asp:DataList>
        </table>
        <div>
        </div>
    </div>

<%}
   else
   { %>


<div class="content">
   <table style="width:100%;">
    <tr>    
        <td class="style2">
        
            <asp:Label ID="Label1" runat="server" Text="Họ"></asp:Label>
        
        </td>
        <td class="style1">
            <asp:TextBox ID="txtFirstName" runat="server" Width="234px"></asp:TextBox>
        </td>
        <td>
            <asp:Label ID="Label2" runat="server" Text=""></asp:Label>
        </td>
    </tr>
    <tr>
        <td class="style2">
        
            Tên
        </td>
        <td class="style1">
            <asp:TextBox ID="txtLastName" runat="server" Width="234px"></asp:TextBox>
        </td>
        <td>
            <asp:Label ID="Label3" runat="server" Text=""></asp:Label>
        </td>
    </tr>
    <tr>
        <td class="style2">
            Email
        </td>
        <td class="style1">
            <asp:TextBox ID="txtEmail" runat="server" Width="234px"></asp:TextBox>
        </td>
        <td>
            <asp:Label ID="Label4" runat="server" Text=""></asp:Label>
        </td>
    </tr>
    <tr>
        <td class="style2">
            Password
        </td>
        <td class="style1">
            <asp:TextBox ID="txtPassword" runat="server" Width="234px" TextMode="Password"></asp:TextBox>
        </td>
        <td>
            <asp:Label ID="Label5" runat="server" Text=""></asp:Label>
        </td>
    </tr>
    <tr>
        <td class="style2">
        
            Address
        
        </td>
        <td class="style1">
            <asp:TextBox ID="txtAddress" runat="server" Width="234px"></asp:TextBox>
        </td>
        <td>
            <asp:Label ID="Label7" runat="server" Text=""></asp:Label>
        </td>
    </tr>
        <tr>
        <td class="style2">
        
            City
        </td>
        <td class="style1">
            <asp:TextBox ID="txtCity" runat="server" Width="234px"></asp:TextBox>
            </td>
                    <td>
            <asp:Label ID="Label8" runat="server" Text=""></asp:Label>
        </td>
    </tr>
        <tr>
        <td class="style2">
        
            Phone
        </td>
        <td class="style1">
            <asp:TextBox ID="txtPhone" runat="server" Width="234px"></asp:TextBox>
            </td>
                    <td>
            <asp:Label ID="Label9" runat="server" Text=""></asp:Label>
        </td>
    </tr>
    <tr>
        <td class="style3">
            <asp:Button ID="btnOK" runat="server" Text="Tạo mới" onclick="btnOK_Click" />
        </td>
        <td class="style1">
            <asp:Button ID="btnCancel" runat="server" Text="Hủy Bỏ" 
                onclick="btnCancel_Click" />
        </td>
        <td>&nbsp;</td>
    </tr>
</table>
</div>
<%} %>
</div>
</form>